//
//  ViewController.m
//  CLBasicsDemo
//
//  Created by 小草毋正 on 2017/9/12.
//  Copyright © 2017年 zbw. All rights reserved.
//



#import "ViewController.h"

#import "CLBasics.h"


@interface ViewController ()

@property (weak, nonatomic) IBOutlet UIView *testView;

@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _testView.layerBorderColor  = [UIColor redColor];
    _testView.layerBorderWidth  = 1.f;
    _testView.layerCornerRadius = 10;
    
    _imageView.image = [UIImage imageWithColor:[UIColor blueColor]];
    
    
    METHODNAME
    
    
//    [self GCD];
    
/**
    [self date];
    [self info];
 */
    
}


- (void)GCD {
    
    [CLGCD userQueueSerialname:@"One" asyncBlock:^{
        
        NSLog(@"begin1");
        [NSThread sleepForTimeInterval:1];
        NSLog(@"end  1");
        
    }];
    [CLGCD userQueueSerialname:@"One" asyncBlock:^{
        
        NSLog(@"begin2");
        [NSThread sleepForTimeInterval:0.5];
        NSLog(@"end  2");
        
    }];
    
    [CLGCD userQueueSerialname:@"Two" asyncBlock:^{
        
        NSLog(@"begin6");
        [NSThread sleepForTimeInterval:0.5];
        NSLog(@"end  6");
        
    }];
    [CLGCD userQueueSerialname:@"Two" asyncBlock:^{
        
        NSLog(@"begin7");
        [NSThread sleepForTimeInterval:0.5];
        NSLog(@"end  7");
        
    }];
    
    
    [CLGCD userQueueConcurrentName:@"ss" asyncBlock:^{
        
        NSLog(@"begin10");
        [NSThread sleepForTimeInterval:0.5];
        NSLog(@"end  10");
        
    }];
    
}



- (void)date {
    
    NSDate *date = [NSDate dateWithTimeIntervalSinceNow:1000];
    NSLog(@"%@", [date toStringFormate:@"yyyy-MM-dd HH:mm:ss.SSS"]);
    NSLog(@"%@", [NSDate toStringFormate:@"yyyy-MM-dd HH:mm:ss.SSS"]);
    
    date = [NSDate dateWithString:@"2016-08-09 12:23:23.345" formate:@"yyyy-MM-dd HH:mm:ss.SSS"];
    NSLog(@"%@", [date toStringFormate:@"yyyy-MM-dd HH:mm:ss.SSS"]);
}


- (void)info {
    
    /// app info
    NSLog(@"app name:%@",    [NSString name]);
    NSLog(@"app version:%@", [NSString version]);
    NSLog(@"app build:%@",   [NSString build]);
    NSLog(@"app bunldID:%@", [NSString bundleID]);
    
    
    /// device info
    NSLog(@"\n\ndevice name:%@", [NSString diveceName]);
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
